package com.orange.score.activity.match;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.orange.common.util.StringUtil;
import com.orange.score.activity.common.CommonFootballActivity;
import com.orange.score.android.service.FollowMatchService;
import com.orange.score.app.ScoreApplication;
import com.orange.score.model.match.FilterMatchStatusType;
import com.orange.score.model.match.FollowMatchManager;
import com.orange.score.model.match.Match;
import com.orange.score.model.match.MatchManager;
import com.orange.score.network.ImageNetworkRequest;
import com.orange.score.network.ResultCodeType;
import com.orange.score.service.MatchService;
import com.orange.score.service.MatchServiceCallBack;
import com.orange.score.utils.DataUtils;
import java.util.Timer;
import java.util.TimerTask;

public class RealtimeMatchDetailActivity extends CommonFootballActivity
  implements MatchServiceCallBack, View.OnTouchListener, GestureDetector.OnGestureListener
{
  private static final int ANALYSIS = 2;
  private static final int DAXIAO = 5;
  private static final int EVENT = 0;
  public static boolean EXIT_APPLICATION = 0;
  private static final int FLING_MIN_DISTANCE = 60;
  private static final int FLING_MIN_VELOCITY = 0;
  private static final int LINEUP = 1;
  private static final String MATCH_DETAIL_HTML = "file:///android_asset/match_detail.html";
  public static final int MAX_LOADING_TIME = 8000;
  private static final int OUPEI = 4;
  private static final int YAPEI = 3;
  public final String IMAGE_URL_PREFIX;
  private String JavaScriptUrl;
  private final String TAG = "RealtimeMatchDetail";
  private String awayImageUrl;
  ImageView awayImageView;
  TextView awayLeagueView;
  private String awayTeamName;
  private String awayTeamRank;
  private String awayTeamScore;
  TextView awayeNameView;
  private Button btnAnalysis;
  private Button btnEvent;
  private Button btnLineup;
  private Button btnOupei;
  private Button btnOverunder;
  private Button btnRefresh;
  private Button btnYapei;
  private Bundle bundle;
  private int currentSelection;
  private String date;
  TextView dateView;
  Handler errorHandler;
  GestureDetector gestureDetector;
  boolean hasProgress;
  Timer hideDialogTimer;
  private String homeImageUrl;
  ImageView homeImageView;
  TextView homeLeagueView;
  TextView homeNameView;
  private String homeTeamName;
  private String homeTeamRank;
  private String homeTeamScore;
  private boolean isStarted;
  private String leagueName;
  boolean loadingHtml;
  boolean loadingJs;
  Handler mHandler;
  Match match;
  private String matchId;
  MatchManager matchManager;
  MatchService matchService;
  TextView scoreView;
  long startLoadingTime;
  private String statusString;
  TextView statusView;
  ImageView vsImageView;
  private WebView webView;

  public RealtimeMatchDetailActivity()
  {
    this.IMAGE_URL_PREFIX = "http://info.bet007.com/image/team/";
    this.currentSelection = 0;
    this.JavaScriptUrl = "";
    this.btnEvent = null;
    this.btnLineup = null;
    this.btnAnalysis = null;
    this.btnYapei = null;
    this.btnOupei = null;
    this.btnOverunder = null;
    this.btnRefresh = null;
    this.mHandler = new Handler();
    this.errorHandler = new Handler();
    this.hasProgress = false;
    this.loadingJs = false;
    this.loadingHtml = true;
    this.startLoadingTime = 0L;
  }

  private String getJsUrl(String paramString, String[] paramArrayOfString)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("javascript:");
    localStringBuilder.append(paramString);
    localStringBuilder.append("(");
    int i = 0;
    while (true)
    {
      if (i >= paramArrayOfString.length)
      {
        localStringBuilder.append(")");
        Log.i("RealtimeMatchDetail", "loadUrl: " + localStringBuilder.toString());
        return localStringBuilder.toString();
      }
      localStringBuilder.append(paramArrayOfString[i]);
      if (i != paramArrayOfString.length - 1)
        localStringBuilder.append(",");
      ++i;
    }
  }

  private MatchManager getMatchManager()
  {
    return getMatchService().getMatchManager();
  }

  private MatchService getMatchService()
  {
    return ((ScoreApplication)getApplication()).getRealtimeMatchService();
  }

  private void initView()
  {
    requestWindowFeature(1);
    setContentView(2130903089);
    this.btnRefresh = ((Button)findViewById(2131558564));
    this.homeImageView = ((ImageView)findViewById(2131558565));
    this.awayImageView = ((ImageView)findViewById(2131558572));
    this.homeNameView = ((TextView)findViewById(2131558567));
    this.awayeNameView = ((TextView)findViewById(2131558569));
    this.homeLeagueView = ((TextView)findViewById(2131558568));
    this.awayLeagueView = ((TextView)findViewById(2131558573));
    this.vsImageView = ((ImageView)findViewById(2131558574));
    this.scoreView = ((TextView)findViewById(2131558570));
    this.dateView = ((TextView)findViewById(2131558566));
    this.statusView = ((TextView)findViewById(2131558571));
    this.btnEvent = ((Button)findViewById(2131558575));
    this.btnLineup = ((Button)findViewById(2131558576));
    this.btnAnalysis = ((Button)findViewById(2131558577));
    this.btnYapei = ((Button)findViewById(2131558578));
    this.btnOupei = ((Button)findViewById(2131558579));
    this.btnOverunder = ((Button)findViewById(2131558580));
    this.webView = ((WebView)findViewById(2131558581));
    this.webView.getSettings().setJavaScriptEnabled(true);
    this.webView.getSettings().setBuiltInZoomControls(true);
    this.webView.setVerticalScrollBarEnabled(true);
    this.webView.setVerticalScrollbarOverlay(true);
    this.webView.getSettings().setAppCacheEnabled(true);
    this.webView.getSettings().setCacheMode(-1);
  }

  private boolean isValidMatchId(String paramString)
  {
    int i;
    if ((paramString != null) && (paramString.length() > 0))
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private void loadMatchDetaiWebView()
  {
    showDefaultMatchDetail();
    showProgressDialog();
    this.webView.loadUrl("file:///android_asset/match_detail.html");
  }

  private void loadMatchDetail()
  {
    this.bundle = getIntent().getExtras();
    this.matchId = this.bundle.getString("matchId");
    if (StringUtil.isEmpty(this.matchId))
    {
      Log.e("RealtimeMatchDetail", "Get matchId from RealtimeMatchActivity is empty.");
      return;
    }
    Log.i("RealtimeMatchDetail", "Load Realtime MatchDetail of  matchId: " + this.matchId);
    if (this.matchManager.getFilterMatchStatus() == FilterMatchStatusType.FOLLOWED)
      this.match = FollowMatchService.getFollowMatchManager().findMatchById(this.matchId);
    while (true)
    {
      while (true)
      {
        if (this.match != null)
          break label162;
        Log.e("RealtimeMatchDetail", "MatchId: " + this.matchId + " not found!");
        finish();
      }
      this.match = this.matchManager.findMatchById(this.matchId);
    }
    label162: this.homeTeamName = this.match.getHomeTeamName();
    int i = this.homeTeamName.indexOf("(");
    if (i != -1)
      this.homeTeamName = this.homeTeamName.substring(0, i);
    this.awayTeamName = this.match.getAwayTeamName();
    this.homeTeamScore = this.match.getHomeTeamScore();
    this.awayTeamScore = this.match.getAwayTeamScore();
    this.leagueName = this.match.getLeagueName();
    this.date = this.match.getDate();
    this.statusString = DataUtils.toMatchStatusString(this.match.getStatus());
    this.isStarted = DataUtils.isStarted(this.match.getStatus()).booleanValue();
    this.homeNameView.setText(this.homeTeamName);
    this.awayeNameView.setText(this.awayTeamName);
    this.scoreView.setText(this.homeTeamScore + " : " + this.awayTeamScore);
    this.dateView.setText(DataUtils.fatmatDate(this.date));
    this.statusView.setText(this.statusString);
    if (!(this.isStarted))
    {
      this.vsImageView.setVisibility(0);
      this.scoreView.setVisibility(4);
    }
    while (true)
    {
      while (true)
        this.matchService.loadMatchDetail(this.matchId, this);
      this.vsImageView.setVisibility(4);
      this.scoreView.setVisibility(0);
    }
  }

  private void resetButtons()
  {
    this.btnAnalysis.setSelected(false);
    this.btnEvent.setSelected(false);
    this.btnLineup.setSelected(false);
    this.btnOupei.setSelected(false);
    this.btnOverunder.setSelected(false);
    this.btnYapei.setSelected(false);
  }

  private void setDetailButtonsListener()
  {
    this.btnEvent.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[3];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayMatchEvent", arrayOfString));
            if (!(this.this$0.loadingHtml))
              RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$4(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 0);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
    this.btnLineup.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[3];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayLineup", arrayOfString));
            RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$10(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 1);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
    this.btnAnalysis.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            int i = RealtimeMatchDetailActivity.access$19(this.this$0).indexOf("(");
            if (i != -1)
              RealtimeMatchDetailActivity.access$20(this.this$0, RealtimeMatchDetailActivity.access$19(this.this$0).substring(0, i));
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[5];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "'" + RealtimeMatchDetailActivity.access$19(this.this$0) + "'";
            arrayOfString[3] = "'" + RealtimeMatchDetailActivity.access$21(this.this$0) + "'";
            arrayOfString[4] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayAnalysis", arrayOfString));
            if (!(this.this$0.loadingHtml))
              RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$3(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 2);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
    this.btnYapei.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[3];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayYapeiDetail", arrayOfString));
            RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$9(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 3);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
    this.btnOupei.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[3];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayOupeiDetail", arrayOfString));
            RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$8(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 4);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
    this.btnOverunder.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        try
        {
          if (RealtimeMatchDetailActivity.access$12(this.this$0, RealtimeMatchDetailActivity.access$11(this.this$0)))
          {
            this.this$0.loadingJs = true;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity1 = this.this$0;
            RealtimeMatchDetailActivity localRealtimeMatchDetailActivity2 = this.this$0;
            String[] arrayOfString = new String[3];
            arrayOfString[0] = "true";
            arrayOfString[1] = RealtimeMatchDetailActivity.access$11(this.this$0);
            arrayOfString[2] = "0";
            RealtimeMatchDetailActivity.access$14(localRealtimeMatchDetailActivity1, RealtimeMatchDetailActivity.access$13(localRealtimeMatchDetailActivity2, "displayOverunder", arrayOfString));
            RealtimeMatchDetailActivity.access$15(this.this$0);
            RealtimeMatchDetailActivity.access$0(this.this$0).loadUrl(RealtimeMatchDetailActivity.access$16(this.this$0));
            RealtimeMatchDetailActivity.access$17(this.this$0);
            RealtimeMatchDetailActivity.access$7(this.this$0).setSelected(true);
            RealtimeMatchDetailActivity.access$18(this.this$0, 5);
          }
          else
          {
            Log.w("RealtimeMatchDetail", "matchId not valid!");
          }
        }
        catch (Exception localException)
        {
          Log.w("RealtimeMatchDetail", "Error ..." + localException.getMessage());
        }
      }
    });
  }

  private String setLeagueAndRank(String paramString1, String paramString2)
  {
    String str = "";
    if (!(StringUtil.isEmpty(paramString1)))
      str = paramString1;
    if (!(StringUtil.isEmpty(paramString2)))
      str = str + paramString2;
    return "[" + str + "]";
  }

  private void setLeftFlingGuestureAction()
  {
    switch (this.currentSelection)
    {
    default:
    case 5:
    case 4:
    case 3:
    case 2:
    case 1:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              return;
              this.btnOupei.performClick();
            }
            this.btnYapei.performClick();
          }
          this.btnAnalysis.performClick();
        }
        this.btnLineup.performClick();
      }
      this.btnEvent.performClick();
    }
  }

  private void setMatchLogoAndRank()
  {
    this.homeImageUrl = "http://info.bet007.com/image/team/" + this.match.getHomeTeamImageUrl();
    this.awayImageUrl = "http://info.bet007.com/image/team/" + this.match.getAwayTeamImageUrl();
    this.homeTeamRank = this.match.getHomeTeamRank();
    this.awayTeamRank = this.match.getAwayTeamRank();
    setTeamImage(this.homeImageView, this.homeImageUrl);
    setTeamImage(this.awayImageView, this.awayImageUrl);
    if ((this.homeTeamRank != null) && (this.homeTeamRank.length() > 0))
    {
      int i = this.homeTeamRank.indexOf("(");
      if (i != -1)
        this.homeTeamRank = this.homeTeamRank.substring(0, i);
      this.homeLeagueView.setText("[" + this.homeTeamRank + "]");
      if ((this.awayTeamRank == null) || (this.awayTeamRank.length() <= 0))
        break label241;
      this.awayLeagueView.setText("[" + this.awayTeamRank + "]");
    }
    while (true)
    {
      while (true)
      {
        return;
        this.homeLeagueView.setText("");
      }
      label241: this.awayLeagueView.setText("");
    }
  }

  private void setRefreshButtonListener()
  {
    this.btnRefresh.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        switch (RealtimeMatchDetailActivity.access$6(this.this$0))
        {
        default:
        case 5:
        case 4:
        case 3:
        case 2:
        case 1:
        case 0:
        }
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    return;
                    RealtimeMatchDetailActivity.access$7(this.this$0).performClick();
                  }
                  RealtimeMatchDetailActivity.access$8(this.this$0).performClick();
                }
                RealtimeMatchDetailActivity.access$9(this.this$0).performClick();
              }
              RealtimeMatchDetailActivity.access$3(this.this$0).performClick();
            }
            RealtimeMatchDetailActivity.access$10(this.this$0).performClick();
          }
          RealtimeMatchDetailActivity.access$4(this.this$0).performClick();
        }
      }
    });
  }

  private void setRigthFlingGuestureAction()
  {
    switch (this.currentSelection)
    {
    default:
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              return;
              this.btnLineup.performClick();
            }
            this.btnAnalysis.performClick();
          }
          this.btnYapei.performClick();
        }
        this.btnOupei.performClick();
      }
      this.btnOverunder.performClick();
    }
  }

  private void setTeamImage(ImageView paramImageView, String paramString)
  {
    if (!(StringUtil.isEmpty(paramString)))
    {
      paramImageView.setTag(paramString);
      ImageNetworkRequest localImageNetworkRequest = new ImageNetworkRequest();
      ImageView[] arrayOfImageView = new ImageView[1];
      arrayOfImageView[0] = paramImageView;
      localImageNetworkRequest.execute(arrayOfImageView);
    }
  }

  private void showDefaultMatchDetail()
  {
    this.webView.addJavascriptInterface(new Object(this)
    {
      public void clickDetailButton()
      {
        this.this$0.mHandler.post(new Runnable(this)
        {
          public void run()
          {
            if (!(RealtimeMatchDetailActivity.access$2(RealtimeMatchDetailActivity.1.access$0(this.this$1))))
              RealtimeMatchDetailActivity.access$3(RealtimeMatchDetailActivity.1.access$0(this.this$1)).performClick();
            while (true)
            {
              RealtimeMatchDetailActivity.1.access$0(this.this$1).loadingHtml = false;
              return;
              RealtimeMatchDetailActivity.access$4(RealtimeMatchDetailActivity.1.access$0(this.this$1)).performClick();
            }
          }
        });
      }
    }
    , "matchDetail");
  }

  private void showProgressDialog()
  {
    this.startLoadingTime = System.currentTimeMillis();
    showProgressDialog("", "加载数据中...");
    startHideDialogTimer();
    this.hasProgress = true;
  }

  private void startHideDialogTimer()
  {
    this.hideDialogTimer = new Timer();
    this.hideDialogTimer.schedule(new HideProgressTask(this, null), 1000L, 1000L);
  }

  private void stopHideDialogTimer()
  {
    if (this.hideDialogTimer != null)
    {
      this.hideDialogTimer.cancel();
      this.hideDialogTimer = null;
    }
  }

  public void loadAllMatchFinish(ResultCodeType paramResultCodeType)
  {
  }

  public void loadMatchDetailFinish(ResultCodeType paramResultCodeType)
  {
    switch ($SWITCH_TABLE$com$orange$score$network$ResultCodeType()[paramResultCodeType.ordinal()])
    {
    default:
    case 1:
    }
    while (true)
    {
      return;
      setMatchLogoAndRank();
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.hideDialogTimer = new Timer();
    this.matchService = getMatchService();
    this.matchManager = getMatchManager();
    initView();
    setRefreshButtonListener();
    setDetailButtonsListener();
  }

  public boolean onDown(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    if ((paramMotionEvent1.getX() - paramMotionEvent2.getX() > 60.0F) && (Math.abs(paramFloat1) > 0F))
    {
      Log.d("RealtimeMatchDetail", "向左手势");
      setLeftFlingGuestureAction();
    }
    while (true)
    {
      do
        return false;
      while ((paramMotionEvent2.getX() - paramMotionEvent1.getX() <= 60.0F) || (Math.abs(paramFloat1) <= 0F));
      Log.d("RealtimeMatchDetail", "向右手势");
      setRigthFlingGuestureAction();
    }
  }

  public void onLongPress(MotionEvent paramMotionEvent)
  {
  }

  protected void onNewIntent(Intent paramIntent)
  {
    super.onNewIntent(paramIntent);
    setIntent(paramIntent);
  }

  protected void onPause()
  {
    super.onPause();
    stopHideDialogTimer();
  }

  public void onRefresh()
  {
    this.loadingHtml = true;
    loadMatchDetaiWebView();
    loadMatchDetail();
  }

  protected void onResume()
  {
    super.onResume();
    if (EXIT_APPLICATION)
      finish();
    while (true)
    {
      return;
      this.loadingHtml = true;
      resetButtons();
      loadMatchDetaiWebView();
      loadMatchDetail();
    }
  }

  public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    return false;
  }

  public void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    Log.d("RealtimeMatchDetail", "touch");
    return this.gestureDetector.onTouchEvent(paramMotionEvent);
  }

  private class HideProgressTask extends TimerTask
  {
    public void run()
    {
      if ((RealtimeMatchDetailActivity.access$0(this.this$0).getProgress() == 100) && (this.this$0.hasProgress) && (this.this$0.loadingJs))
      {
        this.this$0.hideDialog();
        RealtimeMatchDetailActivity.access$1(this.this$0);
        this.this$0.hasProgress = false;
        this.this$0.loadingJs = false;
      }
      while (true)
      {
        do
          return;
        while (System.currentTimeMillis() - this.this$0.startLoadingTime <= 8000L);
        this.this$0.hideDialog();
        RealtimeMatchDetailActivity.access$1(this.this$0);
        RealtimeMatchDetailActivity.access$0(this.this$0).stopLoading();
        this.this$0.hasProgress = false;
        this.this$0.loadingJs = false;
        Log.w("RealtimeMatchDetail", "network speed too slow!");
        this.this$0.errorHandler.post(new Runnable(this)
        {
          public void run()
          {
            Toast.makeText(RealtimeMatchDetailActivity.HideProgressTask.access$1(this.this$1), "你的网速太慢啦，加载失败，请刷新重新加载！", 0).show();
          }
        });
      }
    }
  }
}